3.33 \(\int \csc (e+f x) (a+b \tan ^2(e+f x)) \, dx\)

Optimal. Leaf size=25 \[ \frac{b \sec (e+f x)}{f}-\frac{a \tanh ^{-1}(\cos (e+f x))}{f} \]

[Out]

-((a*ArcTanh[Cos[e + f*x]])/f) + (b*Sec[e + f*x])/f

________________________________________________________________________________________

Rubi [A]  time = 0.0277562, antiderivative size = 25, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.158, Rules used = {3664, 388, 207} \[ \frac{b \sec (e+f x)}{f}-\frac{a \tanh ^{-1}(\cos (e+f x))}{f} \]

Antiderivative was successfully verified.

[In]

Int[Csc[e + f*x]*(a + b*Tan[e + f*x]^2),x]

[Out]

-((a*ArcTanh[Cos[e + f*x]])/f) + (b*Sec[e + f*x])/f

Rule 3664

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Sec[e + f*x], x]}, Dist[1/(f*ff^m), Subst[Int[((-1 + ff^2*x^2)^((m - 1)/2)*(a - b + b*ff^2*x^2)^p)/x^(
m + 1), x], x, Sec[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rule 388

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(d*x*(a + b*x^n)^(p + 1))/(b*(n*
(p + 1) + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(b*(n*(p + 1) + 1)), Int[(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]

Rule 207

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTanh[(Rt[b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \csc (e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx &=\frac{\operatorname{Subst}\left (\int \frac{a-b+b x^2}{-1+x^2} \, dx,x,\sec (e+f x)\right )}{f}\\ &=\frac{b \sec (e+f x)}{f}+\frac{a \operatorname{Subst}\left (\int \frac{1}{-1+x^2} \, dx,x,\sec (e+f x)\right )}{f}\\ &=-\frac{a \tanh ^{-1}(\cos (e+f x))}{f}+\frac{b \sec (e+f x)}{f}\\ \end{align*}

Mathematica [B]  time = 0.0292559, size = 51, normalized size = 2.04 \[ \frac{a \log \left (\sin \left (\frac{e}{2}+\frac{f x}{2}\right )\right )}{f}-\frac{a \log \left (\cos \left (\frac{e}{2}+\frac{f x}{2}\right )\right )}{f}+\frac{b \sec (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[e + f*x]*(a + b*Tan[e + f*x]^2),x]

[Out]

-((a*Log[Cos[e/2 + (f*x)/2]])/f) + (a*Log[Sin[e/2 + (f*x)/2]])/f + (b*Sec[e + f*x])/f

________________________________________________________________________________________

Maple [A]  time = 0.039, size = 36, normalized size = 1.4 \begin{align*}{\frac{b}{f\cos \left ( fx+e \right ) }}+{\frac{a\ln \left ( \csc \left ( fx+e \right ) -\cot \left ( fx+e \right ) \right ) }{f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(f*x+e)*(a+b*tan(f*x+e)^2),x)

[Out]

1/f*b/cos(f*x+e)+1/f*a*ln(csc(f*x+e)-cot(f*x+e))

________________________________________________________________________________________

Maxima [A]  time = 0.988657, size = 54, normalized size = 2.16 \begin{align*} -\frac{a \log \left (\cos \left (f x + e\right ) + 1\right ) - a \log \left (\cos \left (f x + e\right ) - 1\right ) - \frac{2 \, b}{\cos \left (f x + e\right )}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)*(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

-1/2*(a*log(cos(f*x + e) + 1) - a*log(cos(f*x + e) - 1) - 2*b/cos(f*x + e))/f

________________________________________________________________________________________

Fricas [B]  time = 1.96554, size = 162, normalized size = 6.48 \begin{align*} -\frac{a \cos \left (f x + e\right ) \log \left (\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) - a \cos \left (f x + e\right ) \log \left (-\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) - 2 \, b}{2 \, f \cos \left (f x + e\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)*(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

-1/2*(a*cos(f*x + e)*log(1/2*cos(f*x + e) + 1/2) - a*cos(f*x + e)*log(-1/2*cos(f*x + e) + 1/2) - 2*b)/(f*cos(f
*x + e))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \tan ^{2}{\left (e + f x \right )}\right ) \csc{\left (e + f x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)*(a+b*tan(f*x+e)**2),x)

[Out]

Integral((a + b*tan(e + f*x)**2)*csc(e + f*x), x)

________________________________________________________________________________________

Giac [B]  time = 1.38698, size = 80, normalized size = 3.2 \begin{align*} \frac{a \log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right ) + \frac{4 \, b}{\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 1}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)*(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

1/2*(a*log(-(cos(f*x + e) - 1)/(cos(f*x + e) + 1)) + 4*b/((cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 1))/f